<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="layout.xhtml">
        <ui:define name="body">
            <script>
                function title() {
                    document.getElementById('atendimento').className='selected';
                }
                window.onload=title;
            </script>
            <h:form id="incomeCreate" enctype="multipart/form-data">
                <h1 class="title">
                    <a href="#" class="back" onclick="history.go(-1)"/>
                    Gerenciador de Laudos
                </h1>
                <p:messages showDetail="true" autoUpdate="true"  /> 
                <div class="row">
                    <div class="twelve columns">
                        <fieldset>
                            <legend> <h4 style="margin:0 0 10px 0">Resumo</h4></legend>

                            <p:panel id="panelIResumo" style="background: none; border: none;" 
                                     styleClass="container_24 clearfix " >
                                <div class="grid_5">
                                    <p:menu  >
                                        <p:submenu label="Menu">
                                            <p:menuitem url="createAppraisal.xhtml" value="Cadastrar" icon="ui-icon-disk"/>
                                            <p:menuitem url="searchAppraisal.xhtml" value="Pesquisar" icon="ui-icon-search"/>
                                        </p:submenu>

                                    </p:menu>
                                </div>
                                <div class="grid_19">

                                    <p:dataTable id="tablePendentes" var="ap" value="#{managerSearchAppraisal.appraisalPendentes}" 
                                                 styleClass="grid_24"
                                                 rowIndexVar="rowid"
                                                 rowKey="#{ap.id}"
                                                 rows="15" paginator="true"  
                                                 paginatorPosition="bottom"
                                                 emptyMessage="Nenhum registro"
                                                 >  
                                        <f:facet name="header">
                                            Pendentes
                                        </f:facet>  
                                        <p:column headerText="Ação" width="5">

                                            <p:button icon="ui-icon-search" 
                                                      outcome="createAppraisal.xhtml?appraisalEdit=#{ap.id}"
                                                      alt="Visualizar Modelo" title="Visualizar Modelo"
                                                      style="width: 25px; position: relative;"/>

                                        </p:column>
                                        <p:column headerText="Procedimento" style="white-space: pre-wrap;" width="400">  
                                            <h:outputText value="#{ap.diary.procedure.name}"/>
                                        </p:column>  
                                        <p:column headerText="Data" style="white-space: pre-wrap;" width="400">  
                                            <h:outputText value="#{ap.diary.startTime}">
                                                <f:convertDateTime pattern="dd/MM/yyyy" locale="pt,BR"/>
                                            </h:outputText>
                                        </p:column>  
                                        <p:column headerText="Paciente" width="400" style="white-space: pre-wrap;">  
                                            <h:outputText value="#{ap.diary.customer.name}"/>
                                        </p:column>  

                                    </p:dataTable>

                                    <div class="clear"/>
                                    <p:dataTable id="tableAEntregar" var="ap" value="#{managerSearchAppraisal.appraisalEntregar}" 
                                                 styleClass="grid_12"
                                                 rowIndexVar="rowid"
                                                 rowKey="#{ap.id}"
                                                 rows="15" paginator="true"  
                                                 paginatorPosition="bottom"
                                                 emptyMessage="Nenhum registro"
                                                 >  
                                        <f:facet name="header">
                                            Em produção
                                        </f:facet>  
                                        <p:column headerText="Ação" width="5">

                                            <p:button icon="ui-icon-search" 
                                                      outcome="createAppraisal.xhtml?appraisalEdit=#{ap.id}"
                                                      alt="Visualizar Modelo" title="Visualizar Modelo"
                                                      style="width: 25px; position: relative;"/>

                                        </p:column>
                                        <p:column headerText="Procedimento" style="white-space: pre-wrap;" width="400">  
                                            <h:outputText value="#{ap.diary.procedure.name}"/>
                                        </p:column>  
                                        <p:column headerText="Data" style="white-space: pre-wrap;" width="400">  
                                            <h:outputText value="#{ap.diary.startTime}">
                                                <f:convertDateTime pattern="dd/MM/yyyy" locale="pt,BR"/>
                                            </h:outputText>
                                        </p:column>  
                                        <p:column headerText="Paciente" width="400" style="white-space: pre-wrap;">  
                                            <h:outputText value="#{ap.customer.name}"/>
                                        </p:column>  

                                    </p:dataTable>
                                    
                                    
                                    <p:dataTable id="tableConcluido" var="ap" value="#{managerSearchAppraisal.appraisalFinalizados}" 
                                                 styleClass="grid_12"
                                                 rowIndexVar="rowid"
                                                 rowKey="#{ap.id}"
                                                 rows="15" paginator="true"  
                                                 paginatorPosition="bottom"
                                                 emptyMessage="Nenhum registro"
                                                 >  
                                        <f:facet name="header">
                                            A entregar
                                        </f:facet>  
                                        <p:column headerText="Ação" width="5">

                                          <p:button icon="ui-icon-search" 
                                                      outcome="createAppraisal.xhtml?appraisalEdit=#{ap.id}"
                                                      alt="Visualizar Modelo" title="Visualizar Modelo"
                                                      style="width: 25px; position: relative;"/>
                                        </p:column>
                                        <p:column headerText="Procedimento" style="white-space: pre-wrap;" width="400">  
                                            <h:outputText value="#{ap.diary.procedure.name}"/>
                                        </p:column>  
                                        <p:column headerText="Data" style="white-space: pre-wrap;" width="400">  
                                            <h:outputText value="#{ap.diary.startTime}">
                                                <f:convertDateTime pattern="dd/MM/yyyy" locale="pt,BR"/>
                                            </h:outputText>
                                        </p:column>  
                                        <p:column headerText="Paciente" width="400" style="white-space: pre-wrap;">  
                                            <h:outputText value="#{ap.customer.name}"/>
                                        </p:column>  

                                    </p:dataTable>
                                </div>

                            </p:panel>

                        </fieldset>
                    </div>
                </div>
            </h:form>
        </ui:define>
    </ui:composition>
</html>
